package com.viphuli.app.tool.handler;

import java.util.List;

import com.offroader.share.wxapi.ShareUtils;
import com.viphuli.app.tool.R;
import com.viphuli.app.tool.bean.page.CircleSharePage;
import com.viphuli.app.tool.fragment.BaseProgressFragment;

public class CircleWecahtShareResponseHandler extends MyBaseHttpResponseHandler<BaseProgressFragment, CircleSharePage> {

	@Override
	public void deal() {
		
		String appId = caller.getString(R.string.weichat_app_id);
		String appSecret = caller.getString(R.string.weichat_app_secret);
		
		String title = page.getTitle();
		String content = page.getContent();
		String url = page.getUrl();
		String imgUrl = null;

		List<String> picUrls = page.getPics();
		if (picUrls != null && !picUrls.isEmpty()) {
			imgUrl = picUrls.iterator().next();
		}

		ShareUtils.shareToWeiChat(caller.getActivity(), appId, appSecret, title, content, imgUrl, url);

	}

}
